import {createRouter, createWebHistory} from 'vue-router'
import HomePage from "../views/HomePage.vue";

const routes = [
    {
        path: '/home',
        component: HomePage,
        children: [
            {
                path: 'appManager',
                name: '应用管理',
                props:true,
                meta:{title:'应用管理'},
                component: () => import( '../views/AppPage.vue')
            }
            ,
            {
                path: 'userManager',
                name: '用户管理',
                props:true,
                meta:{title:'用户管理'},
                component: () => import( '../views/UserManagerPage.vue')
            }
            ,
            {
                path: 'tenant',
                name: '租户管理',
                props:true,
                meta:{title:'租户管理'},
                component: () => import( '../views/TenantPage.vue')
            }
        ]
    },
    {
        path: '/login',
        name: '登录',
        component: () => import( '../views/LoginPage.vue')
    },
    {
      path:"/",
      name: "首页",
      component: ()=>import('../App.vue')
    }
    ,
    {
        path: '/userDetail',
        name: '用户信息',
        component: () => import( '../views/UserDetailPage.vue')
    }
    ,

    {
        path: '/register',
        name: '注册',
        component: () => import( '../views/RegisterPage.vue')
    },
    {
        path: '/forgetPass',
        name: '忘记密码',
        component: () => import( '../views/ForgetPassPage.vue')
    },
    {
        path: '/changePwd',
        name: '修改密码',
        component: () => import( '../views/ChangePwdPage.vue')
    }
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router
